module.exports = (sequelize, DataTypes) => {
  const User = sequelize.define(
    "user",
    {
      // 在这里定义模型属性
      userId: {
        type: DataTypes.INTEGER, //模型字段类型
        primaryKey: true, //主键
        autoIncrement: true, //自增长
      },
      account: {
        type: DataTypes.STRING,
        allowNull: false,
      },
      password: {
        type: DataTypes.STRING,
        allowNull: false,
      },
      name: {
        type: DataTypes.STRING,
        allowNull: true,
      },
      photo: {
        type: DataTypes.STRING,
        allowNull: true,
      },
      sex: {
        type: DataTypes.STRING,
        allowNull: true,
      },
      birth: {
        type: DataTypes.STRING,
        allowNull: true,
      },
      introduce: {
        type: DataTypes.STRING,
        allowNull: true,
      },
      hobby: {
        type: DataTypes.STRING,
        allowNull: true,
      },
      collect: {
        type: DataTypes.STRING,
        allowNull: true,
      },
    },
    {
      tableName: "user",
      timestamps: true,
    }
  );

  return User;
};
